.tooltipContainer {
    position: relative;
    display: inline-block;
}

.tooltip {
    position: absolute;
    z-index: 1000;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: center;
}

.tooltipContainer:hover .tooltip {
    opacity: 1;
}

/* Directions */
.tooltip.top {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
}

.tooltipContainer:hover .tooltip.top {
    transform: translateX(-50%) translateY(-15px);
}

.tooltip.bottom {
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
}

.tooltipContainer:hover .tooltip.bottom {
    transform: translateX(-50%) translateY(5px);
}

.tooltip.left {
    right: 100%;
    top: 50%;
    transform: translateX(-10px) translateY(-50%);
}

.tooltipContainer:hover .tooltip.left {
    transform: translateX(-5px) translateY(-50%);
}

.tooltip.right {
    left: 100%;
    top: 50%;
    transform: translateX(10px) translateY(-50%);
}

.tooltipContainer:hover .tooltip.right {
    transform: translateX(5px) translateY(-50%);
}

/* Themes */
[data-theme="light"] .tooltip {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 2px 8px var(--shadow-color);
}

[data-theme="dark"] .tooltip {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    box-shadow: 0 2px 8px var(--shadow-color);
}

/* Arrow colors */
[data-theme="light"] .tooltip::after {
    color: var(--bg-primary);
}

[data-theme="dark"] .tooltip::after {
    color: var(--bg-tertiary);
}

/* Sizes */
.tooltip.small {
    font-size: 12px;
    padding: 4px 8px;
}

.tooltip.medium {
    font-size: 14px;
    padding: 8px 12px;
}

.tooltip.large {
    font-size: 16px;
    padding: 12px 16px;
}

/* Arrow */
.tooltip::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.tooltip.top::after {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-color: currentColor transparent transparent transparent;
}

.tooltip.bottom::after {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 6px 6px 6px;
    border-color: transparent transparent currentColor transparent;
}

.tooltip.left::after {
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-color: transparent transparent transparent currentColor;
}

.tooltip.right::after {
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border-width: 6px 6px 6px 0;
    border-color: transparent currentColor transparent transparent;
}

/* Theme-specific arrows */
.tooltip.light::after {
    color: var(--bg-primary);
}

.tooltip.dark::after {
    color: var(--bg-tertiary);
}